package main

import (
	"log"
	"time"

	"git.oschina.net/wkc/master-key-go/handler"
	"github.com/micro/go-micro"

	example "git.oschina.net/wkc/master-key-go/proto/example"
)

func main() {
	// New Service
	service := micro.NewService(
		micro.Name("go.micro.api.master-key-go"),
		micro.Version("v2"),
		micro.RegisterTTL(time.Second*10),
		micro.RegisterInterval(time.Second),
	)

	// Register Handler
	example.RegisterKeyMqHandler(service.Server(), handler.New())

	// Initialise service
	service.Init()

	// Run service
	if err := service.Run(); err != nil {
		log.Fatal(err)
	}
}
